﻿<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" type="text/css" href="../../themes/uimaker/easyui.css" />
    <link rel="stylesheet" type="text/css" href="../../css/uimaker.css" />
    <link rel="stylesheet" type="text/css" href="../../font/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="../../font/icon.css" />
    <script type="text/javascript" src="../../js/jquery.min.js"></script>
    <script type="text/javascript" src="../../js/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../../js/JYH.Core.js"></script>
    <title></title>
    <script type="text/javascript">
        function LoadItem(data) {
            $("#hWorkOrderID").val(data.WorkOrderID);

        }
        $(function () {
            // 使用window.location.href获取当前URL
            const url = new URL(window.location.href);
            // 使用URLSearchParams接口获取URL参数
            const params = new URLSearchParams(url.search);
            const pa = JSON.parse(decodeURIComponent(params.get('params')));
            // 初始化
            if (pa == undefined || pa == null) {
                return false;
            }
            //物料条码打印
            if (pa.FormID == 1) {
                //LoadItem(pa);
                call(pa);
            }
            //储位编号打印
            if (pa.FormID == 2) {
                //LoadItem(pa);
                Strcall(pa);
            }
        })
        //产品条码打印
        function call(queryString) {
            DataService.PostNotJson("/api/FastReport/GetReportById", queryString, (err, res) => {
                if (err) {
                    // 将报告HTML插入到子窗口中
                    //console.log(res);
                    $('#results').html(res);
                } else {
                    console.error('Error fetching report:', res);
                }

            })
        }

        //库位打印
        function Strcall(queryString) {
            DataService.PostNotJson("/api/FastReport/GetReportStrById", queryString, (err, res) => {
                if (err) {
                    // 将报告HTML插入到子窗口中
                    //console.log(res);
                    $('#results').html(res);
                } else {
                    console.error('Error fetching report:', res);
                }

            })
        }
    </script>
</head>
<body>
    <form id="formx" action="javascript:void(null);" οnsubmit="call()">
        <!--<input value="Загрузить" type="submit">-->
    </form>
    <div id="results" typeof="submit"></div><!-- Here the result will be displayed-->
</body>
</html>